<template lang="">
    <div>
        <van-field label='姓名' v-model='form.name'/>
        <van-field label='金额' v-model='form.money'/>
        <van-field label='机构名称' v-model='form.company'/>
        客户经理
        <select v-model='form.manager_id'>
            <option :value="i.id" v-for='i in managelist' :key="i.id">{{i.name}}</option>
        </select>
        注册来源 
        <select v-model='form.refromid'>
                <option :value="i.id" v-for='i in resourcelist' :key="i.id">{{i.name}}</option>
        </select>

        <van-button @click='submit'>提交</van-button>
        
    </div>
</template>
<script>
import axios from 'axios'
export default {
    data(){
        return{
            form:{},
            managelist:[],
            resourcelist:[]
        }
    },
    methods: {
        getmanagelist(){
            axios.get('/managelist').then(res=>{
                this.managelist=res.data.list
                
            })
        },
        getresourcelist(){
            axios.get('/resourcelist1').then(res=>{
                this.resourcelist=res.data.list
            })
        },
        submit(){
            axios.post('/customer_reg',this.form).then(res=>{
                console.log(res)
            })
        }
    },
    mounted() {
        this.getmanagelist()
        this.getresourcelist()
        // this.getresourcelist()
    },
}
</script>
<style lang="">
    
</style>